from application.model import TortoiseBaseModel
from tortoise.fields import CharField, BooleanField, BigIntField, IntField


class ReplyModel(TortoiseBaseModel):
    """
    回复表（二级评论）
    """
    user_id: int = BigIntField(null=False, description="用户ID")
    comment_id: int = BigIntField(null=False, description="回复的评论ID，不能为空")
    depth: int = IntField(null=False, default=1, description="回复深度，1级、2级，不能为空，默认1级")
    content: str = CharField(max_length=280, null=False, description="回复内容，长度280，不能为空")
    is_disabled: bool = BooleanField(null=True, default=False, description="是否禁用")

    class Meta:
        table: str = "reply"
        table_description: str = "评论回复表 - 二级评论"
